<template>
<div>
    <nav>
        <span @click="curr='NewsDetail'">NewsDetail</span>
        <span @click="curr='NewsPicture'">NewsPicture</span>
    </nav>
    <!-- 动态切换组件显示 -->
    <keep-alive>
        <component :is="curr"></component>
    </keep-alive>
</div>
</template>
 
<script >
    import NewsDetail from '@/views/NewsDetail.vue'
    import NewsPicture from '@/views/NewsPicture.vue'
    export default{
        components:{
            NewsDetail,
            NewsPicture,
        },
        data(){
            return{
                curr:"NewsDetail",
            }
        }
    }
</script>
 
<style lang="less">
</style>